// Haxzs Audio Server
// made by omghaxzs
// 2010

#ifndef HTTP_H
#define HTTP_H

#include "main.h"

	enum MESSAGE_TYPE {
		MESSAGE_REQUEST,
		MESSAGE_RESPONSE
	};

	enum REQUEST_METHOD {
		METHOD_GET,
		METHOD_POST
	};

	enum HTTP_VERSION {
		HTTP_VERSION_1_0,
		HTTP_VERSION_1_1
	};
	
	struct HTTP_REQUEST {
		REQUEST_METHOD method;
		std::string uri;
		HTTP_VERSION version;
	};

	struct HTTP_RESPONSE {
		HTTP_VERSION version;
		std::string code;
	};

	struct HTTP_HEADER {
		std::string header, body;
	};

class http {
public:

	MESSAGE_TYPE type;
	HTTP_REQUEST req;
	HTTP_RESPONSE resp;
	std::vector<HTTP_HEADER> headers;
	std::string body;

	bool FindHeader(std::string, HTTP_HEADER*);
	std::string Output();
	bool ParseHTTP(std::string);
};

#endif